package com.study.ssm.injection;


import com.study.ssm.UnitTestBase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;

/**
 * <pre>
 *     project name: SpringStudy
 *     author      : 李琼
 *     e-mail      : 1265137718@qq.com
 *     create time : 2017/9/13 下午11:34
 *     desc        : 描述--//InjectionServiceImpTest TODO
 *     URL         : CSDN:http://blog.csdn.net/qq_22945151
 *                   GitHub:https://github.com/a1265137718
 *     Reference   ://
 *     modifier               :
 *     modification time      :
 *     modify remarks         :
 *
 *     @version: --//TODO
 * </pre>
 */

@RunWith(BlockJUnit4ClassRunner.class)
public class TestInjection extends UnitTestBase {

    public TestInjection(){
        super("classpath:./resources/spring-injection.xml");//也可以这样使用 记得是classpath:的后面
//        super("classpath:spring-injection.xml");
    }

    @Test
    public void testSetter(){
        InjectionServiceImp serviceImp = super.getBean("injectionService");
        serviceImp.save("这是通过Setter方法注入的Service获得的数据");
    }

    @Test
    public void testConstrucor(){
        InjectionService injectionService = super.getBean("injectionService");
        injectionService.save("这是通过构造器注入的Service获得的数据");
    }

}
